// 2013-7-31下午09:38:42  net.betou.trade.entity.main.base.BaseUserGroup.java

package net.betou.trade.entity.main.base;

import java.io.Serializable;
import java.util.Date;

import net.betou.trade.entity.main.UserGroup;

/**
 * 用户分组
 * @author 叶装装
 */
public abstract class BaseUserGroup implements Serializable{
	
	private static final long serialVersionUID = 1250488041922732840L;

	public BaseUserGroup( ){}
	
	private Integer id;
	private String name;          // 分组信息
	private String description; // 描述信息
	private Date createTime; // 创建时间
	private Boolean groupDefault; // 是否是默认
	private Boolean allowRead; // 是否允许被读取
	
	private int hashCode = Integer.MIN_VALUE;

	public Integer getId( ) {
		return id;
	}

	public void setId( Integer id ) {
		this.id = id;
	}

	public String getName( ) {
		return name;
	}

	public void setName( String name ) {
		this.name = name;
	}

	public String getDescription( ) {
		return description;
	}

	public void setDescription( String description ) {
		this.description = description;
	}

	public Date getCreateTime( ) {
		return createTime;
	}

	public void setCreateTime( Date createTime ) {
		this.createTime = createTime;
	}

	public Boolean getGroupDefault( ) {
		return groupDefault;
	}

	public void setGroupDefault( Boolean groupDefault ) {
		this.groupDefault = groupDefault;
	}

	public Boolean getAllowRead( ) {
		return allowRead;
	}

	public void setAllowRead( Boolean allowRead ) {
		this.allowRead = allowRead;
	}
	
	public boolean equals( Object obj ) {
		if( null == obj )
			return false;
		if( !( obj instanceof UserGroup ) )
			return false;
		else{
			UserGroup group = ( UserGroup ) obj;
			if( null == this.getId( ) || null == group.getId( ) )
				return false;
			else
				return( this.getId( ).equals( group.getId( ) ) );
		}
	}

	public int hashCode( ) {
		if( Integer.MIN_VALUE == this.hashCode ){
			if( null == this.getId( ) )
				return super.hashCode( );
			else{
				String hashStr = this.getClass( ).getName( ) + ":" + this.getId( ).hashCode( );
				this.hashCode = hashStr.hashCode( );
			}
		}
		return this.hashCode;
	}
	
	
}
